package com.wangzh.network.tcp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
//        接收
        ServerSocket ss = new ServerSocket(10000);

        Socket accept = ss.accept();
        InputStream is = accept.getInputStream();

        InputStreamReader isr = new InputStreamReader(is);
        BufferedReader bf = new BufferedReader(isr);

        String b;
        while ((b=bf.readLine()) !=null){
            System.out.println(b);
        }


        accept.close();

        ss.close();
    }
}
